SC::Http#
Pushing it forward
The HTTP library is still very incomplete and fragile, but it got to the level of being able serving a simple local html web site, through the new SC::HttpWebServer
class.
The SC::HttpServer
/ SC::HttpWebServer
classes are not solid enough to be used in real internet facing application but they're in better shape than they were the previous month.
SC::HttpClient
is just a very incomplete stub and it currently exists to help testing the server classes.
In the following video a first draft of the HttpWebServer class is being implemented:
This is the list of SC::Http related commits:
SCExample#
Serialize all the things
SCExample
has now a second example called WebServer
that can host a website on a specific port
reading files from a local folder, all integrated with a GUI interface.
The example interface now has two new methods (initAsync
/ closeAsync
) to let samples access
the main SC::AsyncEventLoop
of the application.
The async io event loop is integrated with gui event loop on main thread to make sure that all examples using
SC::Async
can see their completions dispatched on the main (gui) thread. This means that they can modify
the same state variables used by the GUI without needing mutexes.
SC::Async#
Your next favorite Async IO library
Implementing the SC::HttpWebServer
has been putting a little bit of stress on the SC::Async
library, with a few new features, and some bug fixes and QOL improvements.
Features
SC::AsyncSocketReceive
and SC::AsyncFileRead
report End Of File and disconnected events on all platforms, signaling when they are running out of data.
Bugs (fixed)
SC::AsyncSocketWrite
writes were not properly handled on Posix with large buffers (and now there's a test for that)- Timer callbacks were called multiple times on the
io_uring
backend
Quality of Life improvements
It's possible now to de-allocate anySC::AsyncRequest
derived request inside its own callback or just re-configure them and start them again.
That should make it a lot easier handling more complex async data flows.
- Async: Allow AsyncRequests to be deallocated inside their own user callback
- Async: Do not invoke timers callbacks multiple times on io_uring backend
- Async: Handle partial writes in Posix backend
- Async: Mark AsyncRequest as free after Cancelling it
- Async: Report disconnected on AsyncSocketReceive
- Async: Report end of file on AsyncFileRead
- Async: Simplify reporting AsyncSocketReceive disconnected on posix
Additional fixes#
Fix fix fix
And just like every month, a bunch of fixes and improvements to all libraries have been committed.
The most notable bug was in the SC::Process
library, that was preventing proper stdout
inheritance for console applications on Windows.
Github CI was missing all output of the cl.exe
and link.exe
msvc executables spawned by SC::Build
during compilation.
Specifically the Win10/MSVC2019 ci job was failing without printing any error, making it really difficult to figure out how to fix it!
- Console: Attach to parent console on Windows
- Containers: Add methods to obtain arena capacity
- Containers: Split ArenaMapKey
in a separate header - FileSystem: Report file size in new FileStat structure replacing FileTime
- Process: Hide child process console on Windows only if parent process has no console
- SerializationBinary: Prefer using loadExact when loaded schema matches source schema
- SerializationText: Support bool data types for JSON serializer
- Socket: Replace SocketClient::close calls with SocketDescriptor::close
- Time: Expose month and day as strings in Time::Absolute::ParseResult